import Vue from 'vue'
// 引入
import VueI18n from 'vue-i18n'
import elementZh from 'element-ui/lib/locale/lang/zh-CN'
import elementEn from 'element-ui/lib/locale/lang/en'
import myZh from '@/Lang/zh'
import myEn from '@/Lang/en'

// 注册
Vue.use(VueI18n)
// 创建实例
export default new VueI18n({
  // 配置对象
  // 当前地区语言设定
  locale: localStorage.getItem('lang') || 'zh',
  // 字典
  messages: {
    zh: {
      morning: '早上好!',
      niceday: '祝你开心每一天',
      student: {
        number: '学号'
      },
      //   解开合并
      ...elementZh,
      ...myZh

    },
    en: {
      morning: 'Good Morning!',
      niceday: 'have a good day!',
      worker: {
        number: '工号'
      },
      //  解开 合并
      ...elementEn,
      ...myEn
    }
  }

})
